package com.example.test;

import com.example.bean.Product;
import com.example.bean.Student;


public class Main {
    public static void main(String[] args) {
        // 1. 初始化IOC容器（加载beans.xml配置）
        SimpleIOC ioc = new SimpleIOC("beans.xml");

        // 2. 从容器获取Product Bean并输出
        Product product = (Product) ioc.getBean("product1");
        System.out.println("从IOC容器获取Product：" + product);

        // 3. 从容器获取Student Bean并输出
        Student student = (Student) ioc.getBean("student1");
        System.out.println("从IOC容器获取Student：" + student);
    }
}